import request from '@/utils/request';
import { TableListParams, TableListItem } from './data.d';

export async function queryRule(params?: TableListParams) {
  return request('/api/getUser', {
    method:'POST',
    data:{params},
  });
}

export async function removeRule(params: { id: number }) {
  return request(`/api/delUser/${params.id}`, {
    method: 'DELETE',
  });
}

export async function addRule(params: TableListItem) {
  return request('/api/insertUser', {
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    }
  });
}
export async function updateRule(params: TableListParams) {
  return request('/api/putUser', {
    method: 'put',
    data: {
      ...params,
      method: 'update',
    },
  });
}
// export async function exportUsers() {
//   return request('/api/exportUsers', {
//     method: 'Get'
//   });
// }
